package com.solute.web.sso.regist.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solute.domain.UserVO;
import com.solute.web.sso.regist.dao.RegistDao;

@Service
public class RegistService {
	
	private @Autowired RegistDao dao;
	
	public boolean existsEmail(String email) {
		return dao.existsEmail(email) != 0;
	}
	
	@Transactional
	public boolean regist(UserVO userVO) {
		if(!existsEmail(userVO.getEmail())) { 
			dao.addUser(userVO);
			return true;
		}
		else return false;
	}
}
